#!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
1. 字符串拼接，用户输入两个字符串，将它们组合后输出
# """
# str1 = input("请输入一个人的名字: ")
# str2 = input("请输入一个国家名字: ")
# print("世界这么大, {}想去{}看看。".format(str1, str2))
#
#
# """
# 2. 整数序列求和。用户输入一个正整数 N，计算从 1 到 N(包含 1 和 N)相加之后的结果
# """
# n = input("请输入整数N: ")
# sum = 0
# for i in range(int(n)):
#     sum += i + 1
# print(sum)
#
#
# """
# 3. 九九乘法表输出
# """
# for i in range(1, 10):
#     for j in range(1, i+1):
#         print("{}*{}={:2} ".format(j, i, i*j), end=' ')
#     print(' ')
#
#
# """
# 4. 阶乘计算。1+2!+3!+...+10!的结果
# """
# sum, tmp = 0, 1
# for i in range(1, 11):
#     tmp *= i
#     sum += tmp
# print("运算结果是: {}".format(sum))
#
#
# from turtle import *
# fillcolor("red")
# begin_fill()
# while True:
#     forward(200)
#     right(144)
#     if abs(pos()) < 1:
#         break
# end_fill()
#
#
# color('red', 'yellow')
# begin_fill()
# while True:
#     forward(200)
#     left(170)
#     if abs(pos()) < 1:
#         break
# end_fill()
# done()


import turtle
import time
# turtle.speed("fastest")
# turtle.pensize(2)
# for x in range(100):
#     turtle.forward(2*x)
#     turtle.left(90)
# time.sleep(3)


turtle.pensize(2)
turtle.bgcolor("black")
colors = ["red", "yellow", 'purple', 'blue']
turtle.tracer(False)
for x in range(400):
    turtle.forward(2*x)
    turtle.color(colors[x % 4])
    turtle.left(91)
turtle.tracer(True)
time.sleep(10)



